package com.xuexi.demos.controller;

import com.xuexi.demos.entity.DTO.AIDetectionResultDTO;
import com.xuexi.demos.result.Result;
import com.xuexi.demos.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("api/open")
public class StudentConteoller {

    @Autowired
    private StudentService studentService;

    /**
     * 处理AI检测结果
     * @param resultDTO
     * @return
     */
    @PostMapping("/detection-result")
    public Result<String> handleDetectionResult(@RequestBody AIDetectionResultDTO resultDTO) {
        studentService.processDetectionResult(resultDTO);
        return Result.success();
    }
}
